
import random
class doubleball:
    @staticmethod
    def jingtai():
        print("""
        ===================
        双紫色球规则啊
        哈哈哈哈哈
        嚯嚯嚯嚯
        """)

    def __init__(self ,pname):
        self.name = pname
        self.rlist = []
        self.blist = []
        self.bet = 1

    def __str__(self):
        mstr = """
        我叫：{nn}
        投注数：{tt}
        红球数量是：{rr}
        篮球数量是：{bb}

        """.format(nn=self.name ,tt=self.bet ,rr=self.rlist ,bb=self.blist)

        return mstr

    def __del__(self):
        self.rlist.clear()
        self.blist.clear()
        self.be t= 1

    def genredball(self):
        rsrc = [i for i in range(1 ,34)]

        tlist = random.sample(rsrc ,k=6)

        self.rlist.clear()

        self.rlist.extend(tlist)

    def manredball(self):
        tlist = []
        cnt = 1

        while True:
            bnum = input("请输入第{cc}红球(范围是1-33)".format(cc=cnt))
            bnum =  int(bnum)

            if not (bnu m> =1 and bnu m< =34):
                continue
            if bnum in tlist:
                continue
            tlist.append(bnum)
            cn t+ =1


            if len(tlist )> =6:
                break
        self.rlist.clear()

        self.rlist.extend(tlist)

    def genblueball(self):
        bsrc = [i for i in range(1 ,17)]

        mlist = random.choice(bsrc ,k=1)

        self.blist.extend(mlist)

    def manblueball(self):
        bnum = input("请输入篮球")
        bnum = int(bnum)

        if not (bnu m> =1 and bnu m< =16):
            print(""""
            您输入的蓝有误  不在范围内
            请重新输入
            """)

            return

        self.blist.append(bnum)

    def getbet(self):
        mbet = input("请投注")
        mbet = int(mbet)

        self.bet =mbet

    funmenu = ["自选红球", "自选篮球", "机选红球", "机选篮球", "下注", "显示信息", "退出"]

    @classmethod
    def showfunmenu(cls):
        for ind, cont in enumerate(cls.funmenu, start=1):
            print("\t\t{ii},{cc}".format(ii=ind, cc=cont))

    def show(self):
        while True:
            self.showfunmenu()

            choice = input("请选择服务")
            choice = int(choice)

            if choice == 1:
                self.manredball()

            if choice == 2:
                self.manblueball()

            if choice == 3:
                self.genredball()
            if choice == 4:
                self.genblueball()

            if choice == 5:
                self.getbet()

            if choice == 6:
                print(self)

            if choice == 7:
                break


if __name__ == '__main__':
    liyue = doubleball("李岳")
    liyue.jingtai()

    liyue.show()

